import io
import sys


def console(_fun):
    def wrapper(*args, **kw):
        old_stdout = sys.stdout
        sys.stdout = mystdout = io.StringIO()
        _fun(*args, **kw)
        sys.stdout = old_stdout
        tips = mystdout.getvalue()
        return tips

    return wrapper
